package com.cqc.startactivityforactivitydmeo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class BActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_b);
		
		Intent intent = getIntent();
		String name = intent.getStringExtra("name");
		Log.d("tag", "name="+name);
		
		Button btn2 = (Button) findViewById(R.id.btn2);
		btn2.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Log.d("tag", "btn2.setOnClickListener");
				Intent intent = new Intent();
				intent.putExtra("coopretion", "阿里巴巴");
				setResult(3, intent);
				BActivity.this.finish();
			}
		});
	}
	
	@Override
	public void onBackPressed() {
		Log.d("tag", "onBackPressed");
		Intent intent = new Intent();
		intent.putExtra("age", "60");
		setResult(2, intent);
		super.onBackPressed();
	}
}
